package week07_tch;

import sun.security.krb5.internal.Authenticator;

import java.io.FileInputStream;
import java.io.IOException;

import java.util.Properties;

public class PlanFactory {

    private static Properties  prop = new Properties();
    static {
        try{
            prop.load(new FileInputStream("src/week07_tch/planeAuth.properties"));
        }catch(IOException e){
            e.printStackTrace();
        }
    }
    public static Plane creatplane(){
        Plane plane =null;
        try{
            plane=(Plane)Class.forName(prop.getProperty("plane")).newInstance();
        }catch (Exception e){
            e.printStackTrace();
        }
        return plane;
    }
}
